<div id="123" v-cloak>
    <kf-table :data="menus" :page-size="20" border one-screen>
        <el-table-column type="selection"  width="45"></el-table-column>
        <kf-table-tree-column
                ref="menuColumn"
                :remote="getSubMenu"
                prop="moduleName"
                tree-key="moduleCode"
                parent-key="parentCode"
                label="菜单名称" min-width="280"
                header-align="center" align="left"></kf-table-tree-column>
        <el-table-column prop="moduleType" label="菜单类型"  :formatter="menuTypeFormatter" width="120"></el-table-column>
        <el-table-column prop="rightCode" label="菜单编码"  min-width="160"></el-table-column>
        <el-table-column prop="moduleUrl" label="菜单地址"  min-width="360"></el-table-column>
        <!--<el-table-column label="图片"  width="80">-->
            <!--<template scope="scope" >-->
                <!--<span :class="scope.row.moduleImg" style="font-size:1.5em;"/>-->
            <!--</template>-->
        <!--</el-table-column>-->
        <el-table-column label="状态" width="80">
            <template scope="scope" >
                <el-tag :type="scope.row.moduleStatus=='1'?'success':'warning'" close-transition>{{scope.row.moduleStatus=="1"?"启用":"停用"}}</el-tag>
            </template>
        </el-table-column>
        <!--
          <el-table-column prop="remark" label="备注" width="180"></el-table-column>
          -->
        <el-table-column label="操作" width="180">
            <template scope="scope" >
                <el-button @click="addSubMenu(scope.row)" type="text" title="添加子菜单" >添加子菜单</el-button>
                <el-button  @click="editMenu(scope.row)" type="text" class="text-primary" icon="edit" ></el-button>
                <el-button  @click="deleteMenu(scope.row)" type="text" class="text-danger" icon="delete" >删除菜单</el-button>
            </template>
        </el-table-column>
        <el-form :inline="true" slot="tools">
            <el-form-item>
               <!-- <el-input v-model="searchKey" class="el-input--small" class="input-username" placeholder="输入菜单名称" icon="serach">
                    <el-button slot="append" icon="search" title="点击查询" @click="onSearchFwModule"></el-button>
                </el-input>-->
                <el-input v-model="searchKey" class="el-input--small"  placeholder="输入菜单名称" icon="serach">
                    <el-button slot="append" icon="search" title="点击查询" @click="onSearchFwModule"></el-button>
                </el-input>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="addTopMenu" size="small" icon="plus">新增主菜单</el-button>
                <!--<el-button type="primary" @click="editMenuAuth" size="small" icon="edit">菜单权限分配</el-button>-->
            </el-form-item>
        </el-form>
    </kf-table>
    <el-dialog title="编辑菜单" :visible.sync="dialogVisible" size="small">
        <el-form :model="menuFormData"  ref="menuFormData">
            <el-form-item label="菜单名称" :label-width="formLabelWidth"
                          :rules="[{required:true,message:'请输入菜单名称'}]">
                <el-input v-model="menuFormData.moduleName" auto-complete="off" placeholder="菜单名称" size="small"></el-input>
            </el-form-item>
            <el-form-item label="菜单类型" :label-width="formLabelWidth" :rules="[{required:true}]">
                <template>
                    <el-radio-group size="small" v-model="menuFormData.moduleType">
                        <el-radio-button type="primary" v-for="(item,idx) in menuTypeList" :key="idx" :label="item.dimCode">{{item.dimName}}</el-radio-button>
                    </el-radio-group>
                </template>
            </el-form-item>
            <el-form-item label="菜单地址" :label-width="formLabelWidth">
                <el-input v-model="menuFormData.moduleUrl" auto-complete="off" placeholder="菜单url地址，可以为空" size="small"></el-input>
            </el-form-item>
            <el-form-item label="状态" :label-width="formLabelWidth">
                <el-switch v-model="menuFormData.moduleStatus" @change="teamStatusChange(team)"
                           on-color="#15D592" off-color="#C0CCDA" on-text="启用" on-value="1" off-text="停用" off-value="0">
                </el-switch>
            </el-form-item>
            <!--<el-form-item label="图片" :label-width="formLabelWidth">-->
                <!--<span :class="menuFormData.moduleImg" style="font-size:2em;"/>-->
                <!--<el-button type="text" @click="editImg" size="small" style="margin-left:15px;">-->
                    <!--<i class="el-icon-edit"></i> 选择图标-->
                <!--</el-button>-->
                <!--<div class="menu-icons" v-show="showIcons">-->
                    <!--<ul>-->
                        <!--<li v-for="(item,idx) in menuIconList" :key="idx">-->
                            <!--<span :class="item.dimCode" @click="chooseImg(item)"></span>-->
                        <!--</li>-->
                    <!--</ul>-->
                <!--</div>-->
            <!--</el-form-item>-->
            <el-form-item label="菜单顺序" :label-width="formLabelWidth">
                <el-input-number v-model="menuFormData.moduleSeq" :min="0"></el-input-number>
            </el-form-item>
            <el-form-item label="备注" :label-width="formLabelWidth">
                <el-input v-model="menuFormData.remark" auto-complete="off" placeholder="备注" size="small"></el-input>
            </el-form-item>
        </el-form>
        <span slot="footer">
                    <el-button size="small" @click="cancel">取 消</el-button>
                    <el-button size="small" type="primary" @click="saveMenu">保 存</el-button>
                </span>
    </el-dialog>
</div>

